<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>

<script>
  let str = 'hello es6!'


  /*
  setInterval(function () {
    let S = String(new Date().getSeconds())
    console.log(S.padStart(2, '0'))
  }, 1000)
  */

  // console.log(str.repeat(10))


  // console.log(str.includes('ll', 3))
  // console.log(str.endsWith('S6!'))
  // console.log(str.startsWith('he'))
  // console.log(str.includes('es'))
  // console.log(str.indexOf('ES'))

  // console.log(String.fromCharCode(0xFFFF))
  // console.log(String.fromCodePoint(0x20BB7))
  // console.log(String.fromCodePoint(0x20BB7).length)

  // console.log(String.fromCodePoint(0x20BB7).codePointAt(0))
  // console.log(String.fromCodePoint(0x20BB7).codePointAt(1))
  // console.log(String.fromCodePoint(String.fromCodePoint(0x20BB7).codePointAt(0)))
  // console.log(String.fromCodePoint(String.fromCodePoint(0x20BB7).codePointAt(1)))


  // console.log(`Hi\n${2 + 3}`)
  // console.log(String.raw`Hi\n${2 + 3}`)

  // console.log(String.fromCharCode(0x20BB7))
  // console.log(String.fromCodePoint(0x20BB7))
  // console.log(String.fromCodePoint(0x20BB9))
  // console.log(String.fromCodePoint(0x20BB8))

  // let str1 = 'hello'
  // let str2 = 'es6!'
  // console.log(`${str1} ${str2}`)
  // console.log(str1 + ' ' + str2)

  // for (let subStr of str) {
  //   console.log(subStr)
  // }

  // for (let i = 0; i < str.length; i++) {
  //   console.log(str[i])
  // }







  /*
  let person = {
    name: '张三',
    age: 22,
    sex: '男',
    action() {
      alert('hi ~~')
    },
    myColor: undefined
  }

  const { name, ...props } = person
  console.log(name)
  console.log(props)
  */

  // for ()
  // for ( in ) // 对象
  // for ( of ) // 数组
  // let a = 1;
  // let b = 2;
  // [b, a] = [a, b];
  // let z = a
  // a = b
  // b = z
  // console.log(a) // 2
  // console.log(b) // 1

  /*
  let person = {
    name: '张三',
    age: 22,
    sex: '男',
    action() {
      alert('hi ~~')
    },
    myColor: undefined
  }

  let {
    myColor: C = 'red' ,
    sex,
    name,
    action: sayHi
  } = person

  console.log(C)
  */

  // console.log(action)
  // let sayHi = action
  // sayHi()

  // let { sex , name, age, action, sayHi } = person
  // console.log(name)
  // console.log(sex)
  // console.log(action)
  // console.log(sayHi)



  // let arr = [10, [[2], 9], 'hello', {name: '李四'}]
  // let [ , , , obj, obj2 = 'wangwu'] = arr
  // console.log(obj2)

  // let arr = [10, 9, 77]
  // let arr = [10, 9, undefined]
  // let arr = [10, 9, null]
  // let [x, y, z] = arr
  // console.log(z)

  // let obj3
  // console.log(obj2)
  // console.log(obj3)

  // let [x1, , ...tail] = arr
  // console.log(x1)
  // console.log(tail)
  // let [x1, [num, num1], , a] = arr
  // console.log(x1)
  // console.log(num)
  // console.log(num1)
  // console.log(a)






</script>
</body>
</html>